package sys.news.service;


import sys.news.pojo.News;
import sys.news.vo.Page;

import java.util.List;

public interface NewsSerice {

    /**
     * 添加新闻内容
     * @param news
     * @return
     * @throws RuntimeException
     */
    public boolean addNews(News news)throws RuntimeException;

    /**
     * 删除新闻内容
     * @param news
     * @return
     * @throws RuntimeException
     */
    public boolean delNews(int news)throws RuntimeException;

    /**
     * 修改新闻
     * @param news
     * @return
     * @throws RuntimeException
     */
    public boolean updateNews(News news)throws RuntimeException;

    /**
     * 查询所有新闻
     * @param
     * @return
     * @throws RuntimeException
     */
    public List<News> getAllNews()throws RuntimeException;

    /**
     * 通过id查询新闻
     * @param nid
     * @return
     * @throws RuntimeException
     */
    public News getByIdNews(int nid)throws RuntimeException;

    /**
     * 分页查询新闻（动态  1.所有  2.某个主题）
     * @param page
     * @param news
     * @return
     * @throws RuntimeException
     */
    public Page<News> getNewsByPage(Page<News> page,News news)throws RuntimeException;

}
